using Newtonsoft.Json;
using SqlSugar;

namespace Ln.Fram.SqlSugarCore.Abstractions;

public class SqlSugarConnOptions
{
	/// <summary>
	/// 开启Saas多租户
	/// </summary>
	public bool EnabledSaasMultiTenancy { get; set; } = false;
	
	public SqlSugarLineConnOptions DefaultLine { get; set; }

	/// <summary>
	/// 行数据配置
	/// </summary>
	public SqlSugarLineConnOptions[] LineList { get; set; }
}

public class SqlSugarLineConnOptions
{
	/// <summary>
	/// Id
	/// </summary>
	public string? ConfigId { get; set; }

	/// <summary>
	/// 连接字符串(如果开启多租户，也就是默认库了)，必填
	/// </summary>
	public string? Url { get; set; }

	/// <summary>
	/// 数据库类型
	/// </summary>
	public DbType? DbType { get; set; }

	/// <summary>
	/// 开启种子数据
	/// </summary>
	public bool EnabledDbSeed { get; set; } = false;

	/// <summary>
	/// 开启驼峰转下划线
	/// </summary>
	public bool EnableUnderLine { get; set; } = false;

	/// <summary>
	/// 开启CodeFirst
	/// </summary>
	public bool EnabledCodeFirst { get; set; } = false;

	/// <summary>
	/// 开启sql日志
	/// </summary>
	public bool EnabledSqlLog { get; set; } = true;

	/// <summary>
	/// 开启读写分离
	/// </summary>
	public bool EnabledReadWrite { get; set; } = false;

	/// <summary>
	/// 读写分离
	/// </summary>
	public List<string>? ReadUrl { get; set; }
}